(* Content-type: application/vnd.wolfram.mathematica *)

(*** Wolfram Notebook File ***)
(* http://www.wolfram.com/nb *)

(* CreatedBy='Mathematica 10.4' *)

(*CacheID: 234*)
(* Internal cache information:
NotebookFileLineBreakTest
NotebookFileLineBreakTest
NotebookDataPosition[       158,          7]
NotebookDataLength[     13200,        464]
NotebookOptionsPosition[      9432,        351]
NotebookOutlinePosition[     12186,        426]
CellTagsIndexPosition[     12068,        420]
WindowTitle->CompleteSquare
WindowFrame->Normal*)

(* Beginning of Notebook Content *)
Notebook[{
Cell[BoxData[GridBox[{
   {Cell["FEYN CALC SYMBOL", "PacletNameCell"], Cell[TextData[Cell[BoxData[
     ActionMenuBox[
      FrameBox[
       InterpretationBox[Cell[TextData[{
         "URL",
         StyleBox[" \[FilledDownTriangle]", "AnchorBarArrow",
          StripOnInput->False]
        }]],
        TextCell[
         Row[{"URL", 
           Style[" \[FilledDownTriangle]", "AnchorBarArrow"]}]]],
       StripOnInput->False], {"\<\"FeynCalc/ref/CompleteSquare\"\>":>
      None, "\<\"Copy Wolfram Documentation Center URL\"\>":>
      Module[{DocumentationSearch`Private`nb$}, 
       DocumentationSearch`Private`nb$ = NotebookPut[
          Notebook[{
            Cell["FeynCalc/ref/CompleteSquare"]}, Visible -> False]]; 
       SelectionMove[DocumentationSearch`Private`nb$, All, Notebook]; 
       FrontEndTokenExecute[DocumentationSearch`Private`nb$, "Copy"]; 
       NotebookClose[DocumentationSearch`Private`nb$]; Null], 
      Delimiter, "\<\"Copy web URL\"\>":>
      Module[{DocumentationSearch`Private`nb$}, 
       DocumentationSearch`Private`nb$ = NotebookPut[
          Notebook[{
            Cell[
             BoxData[
              MakeBoxes[
               Hyperlink[
               "http://reference.wolfram.com/language/FeynCalc/ref/\
CompleteSquare.html"], StandardForm]], "Input", TextClipboardType -> 
             "PlainText"]}, Visible -> False]]; 
       SelectionMove[DocumentationSearch`Private`nb$, All, Notebook]; 
       FrontEndTokenExecute[DocumentationSearch`Private`nb$, "Copy"]; 
       NotebookClose[DocumentationSearch`Private`nb$]; 
       Null], "\<\"Go to web URL\"\>":>FrontEndExecute[{
        NotebookLocate[{
          URL[
           StringJoin[
            If[
             TrueQ[DocumentationBuild`Make`Private`wsmlinkQ$45130], 
             "http://reference.wolfram.com/system-modeler/", 
             "http://reference.wolfram.com/language/"], 
            "FeynCalc/ref/CompleteSquare", ".html"]], None}]}]},
      Appearance->None,
      MenuAppearance->Automatic,
      MenuStyle->"URLMenu"]],
     LineSpacing->{1.4, 0}]], "AnchorBar"]}
  }]], "AnchorBarGrid",
 GridBoxOptions->{GridBoxItemSize->{"Columns" -> {
     Scaled[0.65], {
      Scaled[0.34]}}, "ColumnsIndexed" -> {}, "Rows" -> {{1.}}, 
   "RowsIndexed" -> {}}},
 CellID->1],

Cell[TextData[{
 Cell["CompleteSquare", "ObjectName"],
 Cell[BoxData[
  InterpretationBox[
   StyleBox[
    GraphicsBox[{},
     BaselinePosition->Baseline,
     ImageSize->{8, 0}],
    CacheGraphics->False],
   Spacer[8]]]],
 Cell[BoxData[""], "ObjectNameTranslation"]
}], "ObjectNameGrid"],

Cell[BoxData[GridBox[{
   {"", Cell[TextData[{
     Cell[BoxData["CompleteSquare"], "InlineFormula"],
     " \[LineSeparator]completes ",
     "the square of a second order polynomial in the momentum x. \
CompleteSquare[a ",
     Cell[BoxData[
      FormBox[
       SuperscriptBox[
        StyleBox["p",
         FontSlant->"Plain"], "2"], TraditionalForm]]],
     "+b p+c, p] \[Rule] -",
     Cell[BoxData[
      FormBox[
       SuperscriptBox[
        StyleBox["b",
         FontSlant->"Plain"], "2"], TraditionalForm]]],
     "/(4 a)+c+a (b/(2 a)+x)^2. CompleteSquare[a ",
     Cell[BoxData[
      FormBox[
       SuperscriptBox[
        StyleBox["p",
         FontSlant->"Plain"], "2"], TraditionalForm]]],
     "+b p+c, p, q] \[Rule] {-",
     Cell[BoxData[
      FormBox[
       SuperscriptBox[
        StyleBox["b",
         FontSlant->"Plain"], "2"], TraditionalForm]]],
     "/(4 a)+c+a ",
     Cell[BoxData[
      FormBox[
       SuperscriptBox[
        StyleBox["q",
         FontSlant->"Plain"], "2"], TraditionalForm]]],
     ", q\[Rule]b/(2 a)+p}."
    }]]}
  }]], "Usage",
 GridBoxOptions->{
 GridBoxBackground->{
  "Columns" -> {{None}}, "ColumnsIndexed" -> {}, "Rows" -> {{None}}, 
   "RowsIndexed" -> {}}},
 CellID->982511436],

Cell[CellGroupData[{

Cell[TextData[{
 Cell[BoxData[
  InterpretationBox[
   StyleBox[
    GraphicsBox[{},
     BaselinePosition->Baseline,
     ImageSize->{6, 0}],
    CacheGraphics->False],
   Spacer[6]]]],
 "Examples",
 "\[NonBreakingSpace]\[NonBreakingSpace]",
 Cell["(1)", "ExampleCount"]
}], "PrimaryExamplesSection",
 WholeCellGroupOpener->True,
 CellTags->"PrimaryExamplesSection",
 CellID->550511005],

Cell[CellGroupData[{

Cell[TextData[{
 "Basic Examples",
 "\[NonBreakingSpace]\[NonBreakingSpace]",
 Cell["(1)", "ExampleCount"]
}], "ExampleSection", "ExampleSection",
 WholeCellGroupOpener->True,
 CellID->1465899488],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"5", 
  RowBox[{"SP", "[", 
   RowBox[{
    RowBox[{
     RowBox[{"2", "p"}], "+", 
     RowBox[{"3", "r"}]}], ",", 
    RowBox[{"p", "+", "r"}]}], "]"}]}]], "Input",
 CellLabel->"In[1]:=",
 CellID->42990982],

Cell[BoxData[
 FormBox[
  RowBox[{"5", " ", 
   RowBox[{"(", 
    FormBox[
     RowBox[{
      FormBox["\<\"(\"\>",
       TraditionalForm], 
      FormBox[
       FormBox[
        RowBox[{
         OverscriptBox[
          FormBox["p",
           TraditionalForm], "_"], "+", 
         OverscriptBox[
          FormBox["r",
           TraditionalForm], "_"]}],
        TraditionalForm],
       TraditionalForm], 
      FormBox["\<\")\"\>",
       TraditionalForm], 
      FormBox["\<\"\[CenterDot]\"\>",
       TraditionalForm], 
      FormBox["\<\"(\"\>",
       TraditionalForm], 
      FormBox[
       FormBox[
        RowBox[{
         RowBox[{"2", " ", 
          OverscriptBox[
           FormBox["p",
            TraditionalForm], "_"]}], "+", 
         RowBox[{"3", " ", 
          OverscriptBox[
           FormBox["r",
            TraditionalForm], "_"]}]}],
        TraditionalForm],
       TraditionalForm], 
      FormBox["\<\")\"\>",
       TraditionalForm]}],
     TraditionalForm], ")"}]}], TraditionalForm]], "Output",
 ImageSize->{179, 16},
 ImageMargins->{{0, 0}, {0, 0}},
 ImageRegion->{{0, 1}, {0, 1}},
 CellLabel->"Out[1]="]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"CompleteSquare", "[", 
  RowBox[{"%", ",", "p"}], "]"}]], "Input",
 CellTags->"CompleteSquare",
 CellLabel->"In[2]:=",
 CellID->1825124248],

Cell[BoxData[
 FormBox[
  RowBox[{
   RowBox[{"10", " ", 
    SuperscriptBox[
     RowBox[{
      FormBox["\<\"(\"\>",
       TraditionalForm], 
      FormBox[
       FormBox[
        RowBox[{
         OverscriptBox[
          FormBox["p",
           TraditionalForm], "_"], "+", 
         FractionBox[
          RowBox[{"5", " ", 
           OverscriptBox[
            FormBox["r",
             TraditionalForm], "_"]}], "4"]}],
        TraditionalForm],
       TraditionalForm], 
      FormBox["\<\")\"\>",
       TraditionalForm]}], "2"]}], "-", 
   FractionBox[
    RowBox[{"5", " ", 
     SuperscriptBox[
      FormBox[
       OverscriptBox[
        FormBox["r",
         TraditionalForm], "_"],
       TraditionalForm], "2"]}], "8"]}], TraditionalForm]], "Output",
 ImageSize->{154, 40},
 ImageMargins->{{0, 0}, {0, 0}},
 ImageRegion->{{0, 1}, {0, 1}},
 CellTags->"CompleteSquare",
 CellLabel->"Out[2]="]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{
  RowBox[{
   RowBox[{"%", "-", "%%"}], "//", "ScalarProductExpand"}], "//", 
  "Expand"}]], "Input",
 CellTags->"CompleteSquare",
 CellLabel->"In[3]:=",
 CellID->1768514898],

Cell[BoxData[
 FormBox["0", TraditionalForm]], "Output",
 ImageSize->{13, 14},
 ImageMargins->{{0, 0}, {0, 0}},
 ImageRegion->{{0, 1}, {0, 1}},
 CellTags->"CompleteSquare",
 CellLabel->"Out[3]="]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"CompleteSquare", "[", 
  RowBox[{
   RowBox[{"5", 
    RowBox[{"SP", "[", 
     RowBox[{
      RowBox[{
       RowBox[{"2", "p"}], "+", 
       RowBox[{"3", "r"}]}], ",", 
      RowBox[{"p", "+", "r"}]}], "]"}]}], ",", "p", ",", "q"}], 
  "]"}]], "Input",
 CellTags->"CompleteSquare",
 CellLabel->"In[4]:=",
 CellID->1850431752],

Cell[BoxData[
 FormBox[
  RowBox[{"{", 
   RowBox[{
    RowBox[{
     RowBox[{"10", " ", 
      SuperscriptBox[
       FormBox[
        OverscriptBox[
         FormBox["q",
          TraditionalForm], "_"],
        TraditionalForm], "2"]}], "-", 
     FractionBox[
      RowBox[{"5", " ", 
       SuperscriptBox[
        FormBox[
         OverscriptBox[
          FormBox["r",
           TraditionalForm], "_"],
         TraditionalForm], "2"]}], "8"]}], ",", 
    RowBox[{
     OverscriptBox[
      FormBox["q",
       TraditionalForm], "_"], "\[Rule]", 
     RowBox[{
      OverscriptBox[
       FormBox["p",
        TraditionalForm], "_"], "+", 
      FractionBox[
       RowBox[{"5", " ", 
        OverscriptBox[
         FormBox["r",
          TraditionalForm], "_"]}], "4"]}]}]}], "}"}], 
  TraditionalForm]], "Output",
 ImageSize->{208, 38},
 ImageMargins->{{0, 0}, {0, 0}},
 ImageRegion->{{0, 1}, {0, 1}},
 CellTags->"CompleteSquare",
 CellLabel->"Out[4]="]
}, Open  ]]
}, Open  ]]
}, Open  ]],

Cell[" ", "FooterCell"]
},
Saveable->False,
ScreenStyleEnvironment->"Working",
WindowSize->{725, 750},
WindowMargins->{{278, Automatic}, {Automatic, 28}},
WindowTitle->"CompleteSquare",
TaggingRules->{
 "ModificationHighlight" -> False, "ColorType" -> "SymbolColor", "LinkTrails" -> 
  GridBox[{{
      RowBox[{
        ButtonBox[
        "FeynCalc", ButtonData -> "paclet:FeynCalc/guide/FeynCalc", 
         BaseStyle -> {"Link", "DockedLinkTrail"}]}]}}, ColumnAlignments -> 
    Left], "HasOptions" -> False, "ExampleCounter" -> 1, "NeedPlatMsgIn" -> 
  None, "RootCaptions" -> "", 
  "Metadata" -> {
   "built" -> "{2020, 6, 20, 19, 3, 8.876245}", 
    "history" -> {"9.0", "", "", ""}, "context" -> "FeynCalc`", 
    "keywords" -> {}, "specialkeywords" -> {}, 
    "tutorialcollectionlinks" -> {}, "index" -> True, "label" -> 
    "Feyn Calc Symbol", "language" -> "en", "paclet" -> "FeynCalc", "status" -> 
    "None", "summary" -> 
    "CompleteSquare completes the square of a second order polynomial in the \
momentum x. CompleteSquare[a p^2+b p+c, p] -> -b^2/(4 a)+c+a (b/(2 a)+x)^2. \
CompleteSquare[a p^2+b p+c, p, q] -> {-b^2/(4 a)+c+a q^2, q->b/(2 a)+p}.", 
    "synonyms" -> {}, "tabletags" -> {}, "title" -> "CompleteSquare", 
    "titlemodifier" -> "", "windowtitle" -> "CompleteSquare", "type" -> 
    "Symbol", "uri" -> "FeynCalc/ref/CompleteSquare"}, "SearchTextTranslated" -> 
  ""},
CellContext->"Global`",
FrontEndVersion->"10.4 for Linux x86 (64-bit) (April 11, 2016)",
StyleDefinitions->Notebook[{
   Cell[
    StyleData[
    StyleDefinitions -> FrontEnd`FileName[{"Wolfram"}, "Reference.nb"]]], 
   Cell[
    StyleData["Input"], CellContext -> "Global`"], 
   Cell[
    StyleData["Output"], CellContext -> "Global`"]}, Visible -> False, 
  FrontEndVersion -> "10.4 for Linux x86 (64-bit) (April 11, 2016)", 
  StyleDefinitions -> "Default.nb"]
]
(* End of Notebook Content *)

(* Internal cache information *)
(*CellTagsOutline
CellTagsIndex->{
 "PrimaryExamplesSection"->{
  Cell[4449, 135, 387, 15, 31, "PrimaryExamplesSection",
   CellTags->"PrimaryExamplesSection",
   CellID->550511005]},
 "CompleteSquare"->{
  Cell[6500, 224, 163, 5, 27, "Input",
   CellTags->"CompleteSquare",
   CellID->1825124248],
  Cell[6666, 231, 910, 35, 61, "Output",
   CellTags->"CompleteSquare"],
  Cell[7613, 271, 198, 7, 27, "Input",
   CellTags->"CompleteSquare",
   CellID->1768514898],
  Cell[7814, 280, 195, 6, 35, "Output",
   CellTags->"CompleteSquare"],
  Cell[8046, 291, 352, 13, 27, "Input",
   CellTags->"CompleteSquare",
   CellID->1850431752],
  Cell[8401, 306, 965, 38, 59, "Output",
   CellTags->"CompleteSquare"]}
 }
*)
(*CellTagsIndex
CellTagsIndex->{
 {"PrimaryExamplesSection", 11402, 397},
 {"CompleteSquare", 11543, 401}
 }
*)
(*NotebookFileOutline
Notebook[{
Cell[586, 21, 2297, 53, 53, "AnchorBarGrid",
 CellID->1],
Cell[2886, 76, 291, 11, 45, "ObjectNameGrid"],
Cell[3180, 89, 1244, 42, 108, "Usage",
 CellID->982511436],
Cell[CellGroupData[{
Cell[4449, 135, 387, 15, 31, "PrimaryExamplesSection",
 CellTags->"PrimaryExamplesSection",
 CellID->550511005],
Cell[CellGroupData[{
Cell[4861, 154, 196, 6, 26, "ExampleSection",
 CellID->1465899488],
Cell[CellGroupData[{
Cell[5082, 164, 231, 9, 27, "Input",
 CellID->42990982],
Cell[5316, 175, 1147, 44, 37, "Output"]
}, Open  ]],
Cell[CellGroupData[{
Cell[6500, 224, 163, 5, 27, "Input",
 CellTags->"CompleteSquare",
 CellID->1825124248],
Cell[6666, 231, 910, 35, 61, "Output",
 CellTags->"CompleteSquare"]
}, Open  ]],
Cell[CellGroupData[{
Cell[7613, 271, 198, 7, 27, "Input",
 CellTags->"CompleteSquare",
 CellID->1768514898],
Cell[7814, 280, 195, 6, 35, "Output",
 CellTags->"CompleteSquare"]
}, Open  ]],
Cell[CellGroupData[{
Cell[8046, 291, 352, 13, 27, "Input",
 CellTags->"CompleteSquare",
 CellID->1850431752],
Cell[8401, 306, 965, 38, 59, "Output",
 CellTags->"CompleteSquare"]
}, Open  ]]
}, Open  ]]
}, Open  ]],
Cell[9405, 349, 23, 0, 41, "FooterCell"]
}
]
*)

(* End of internal cache information *)

